package com.partition.mysql.config;

import com.partition.mysql.bean.PartitionItem;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * 表分区配置
 * @author hexinglin
 * @created 2022-04-08 15:55
 **/
@Configuration
@ConfigurationProperties(prefix = "partition.config")
public class PartitionConfig {

    /**
     * 是否启用分区，默认不启用
     */
    private Boolean partitionEnable = false;

    /**
     * 定时任务cron表达式，默认每天凌晨1点执行
     */
    private String cron = "0 0 1 * * ?";

    /**
     * job是一个列表
     */
    private List<PartitionItem> partItems;

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public List<PartitionItem> getPartItems() {
        return partItems;
    }

    public void setPartItems(List<PartitionItem> partItems) {
        this.partItems = partItems;
    }

    public Boolean getPartitionEnable() {
        return partitionEnable;
    }

    public void setPartitionEnable(Boolean partitionEnable) {
        this.partitionEnable = partitionEnable;
    }
}
